import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:boss/ui/widget/radioList/radio.dart' as radio;

class DeliveryFreeRadio extends StatelessWidget {
  final bool isSelected;
  final ValueChanged<bool> onChanged;

  const DeliveryFreeRadio({
    Key key,
    this.isSelected,
    this.onChanged,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        if (onChanged != null) {
          onChanged(!isSelected);
        }
      },
      child: Row(
        children: <Widget>[
          Text('免费配送'),
          SizedBox(
            width: 15.w,
          ),
          radio.Radio(
            isSelected: isSelected,
            width: 30.w,
            height: 30.w,
          ),
        ],
      ),
    );
  }
}
